// BlueChessDialog.cpp : implementation of the CBlueChessDialog class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resourceppc.h"

#include "aboutdlg.h"
#include "BlueChessDialog.h"
#include "src/BTManager.h"

BOOL CBlueChessDialog::PreTranslateMessage(MSG* pMsg)
{
	return CWindow::IsDialogMessage(pMsg);
}

bool CBlueChessDialog::AppHibernate( bool bHibernate)
{
	// Insert your code here or delete member if not relevant
	return bHibernate;
}

bool CBlueChessDialog::AppNewInstance( LPCTSTR lpstrCmdLine)
{
	// Insert your code here or delete member if not relevant
	return false;
}

void CBlueChessDialog::AppSave()
{
	CAppInfo info;
	// Insert your code here or delete member if not relevant
}

BOOL CBlueChessDialog::OnIdle()
{
	return FALSE;
}

LRESULT CBlueChessDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{

	HWND hMenuBar = CreateMenuBar(ATL_IDM_MENU_DONECANCEL);
	UIAddToolBar(hMenuBar);
	UIAddChildWindowContainer(m_hWnd);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return bHandled = FALSE;
}

LRESULT CBlueChessDialog::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	CAboutDlg dlg;
	dlg.DoModal();
	return 0;
}

LRESULT CBlueChessDialog::OnStart( WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/ )
{
	BTManager * manager = BTManager::GetInstance();
	manager->Init(TRUE);
	return 0;
}
